#include <my_head.h>

int main(int argc, const char *argv[]){
    int sockfd = socket(AF_INET, SOCK_STREAM, 0);
    if(-1 == sockfd)
        ERR_LOG("socket error");
    // 获取发送缓冲区大小
    int send_buff_size = 0;
    int send_buff_size_len = sizeof(send_buff_size);
    if(-1 == getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &send_buff_size, &send_buff_size_len))
        ERR_LOG("getsockopt error");
    printf("发送缓冲区的默认大小是 : %dKB\n", send_buff_size/1024); // 16KB
    // 获取接收缓冲区大小
    int recv_buff_size = 0;
    int recv_buff_size_len = sizeof(recv_buff_size);
    if(-1 == getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &recv_buff_size, &recv_buff_size_len))
        ERR_LOG("getsockopt error");
    printf("接收缓冲区的默认大小是 : %dKB\n", recv_buff_size/1024); // 128KB

    return 0;
}